package com.cyou.qb.admin.web;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.cyou.nad.dao.PojoPage;
import com.cyou.nad.tag.table.pagebar.PageBar173App;
import com.cyou.nad.tag.table.pagebar.SimplePageBar;
import com.cyou.qb.common.domain.Active;
import com.cyou.qb.common.service.ActivityService;

@Controller
@RequestMapping(value = "/pageTest")
public class PageTestController extends BaseController{
	
	@Resource(name = "ActivityServiceImpl")
	private ActivityService activityService;
	
	@RequestMapping(value = "/index")
	public String index(Model model, HttpServletRequest request, HttpServletResponse response) {
		PojoPage<Active> page = activityService.pageQuery("byEndTime", getPageNo(), getPageSize(5));
		model.addAttribute("page",page);
		model.addAttribute("list",page.getData());
		model.addAttribute("bar",PageBar173App.getInstance());
		return "simple/pagetest";
	}
}
